package com.josn.messagewall.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;

@Component
public class Md5Util {

    @Value("${md5.salt}")
    private String salt;

    public String getMd5String(String passwd) {
        String newpasswd = passwd + salt;
        String md5String = DigestUtils.md5DigestAsHex(newpasswd.getBytes());
        return md5String;
    }
}
